from flask import Flask
import redis

r = redis.Redis(host='redis', port=6379)
r.delete('key')
r.set('key', 'ThoughtWorks')
r.expire('key', 10)
redis_value = r.get('key')

app = Flask(__name__)


@app.route('/', methods=['GET', 'POST'])
def home():
    return '<h1>Home %s</h1>' % redis_value.decode()


if __name__ == '__main__':
    app.run(host='0.0.0.0', port='5000', debug=True)
